home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: Jan 30, 1996
- // Author: laf
- //
- // Description:
- // These procs create the controls for a propMod tool property sheet.
- // See also propModValues.mel for procs that set the state of the
- // property sheet.
- //
- //
- // Input Arguments:
- // None.
- //
- // Return Value:
- // None.
- //
-
- global proc propModSpaceCallback( int $space )
- {
- int $currentMode = eval("propModCtx -q -t " + `currentCtx`);
- int $newMode;
- int $ws;
-
- if( $space == 1 )
- {
- // World space
- $newMode = $currentMode - 5;
- $ws = 1;
- radioButtonGrp -e -vis 1 modType3;
- }
- else
- {
- // Parametric space
- $newMode = $currentMode + 5;
-
- if ($newMode == 10)
- {
- // If we switch from NURBS : World Space to Parametric we're left
- // in an undefined state, switch to Linear : Parametric
-
- $newMode = 6;
- }
-
- $ws = 0;
- radioButtonGrp -e -vis 0 modType3;
- }
-
-
- propModCtx -e -t $newMode -ws $ws `currentCtx`;
- propModDimmer $newMode;
- }
-
- global proc propModTypeCallback( int $type )
- {
- int $currentSpace = eval("propModCtx -q -ws " + `currentCtx`);
- int $newType;
-
- if( $currentSpace == 1 )
- {
- $newType = $type;
- }
- else
- {
- $newType = $type + 5;
- }
-
- propModCtx -e -t $newType `currentCtx`;
- propModDimmer $newType;
- }
-
- proc propModSetCallbacks( string $parent )
- //
- // Description:
- // Set the callbacks for all of the controls in the dialog.
- // Modifying the context will force propModValues() to be called
- //
- //
- {
- setParent $parent;
-
- radioButtonGrp -e
- -on1 "propModSpaceCallback 1"
- -on2 "propModSpaceCallback 2" modSpace;
-
- radioButtonGrp -e
- -on1 "propModTypeCallback 1"
- -on2 "propModTypeCallback 2" modType;
-
- radioButtonGrp -e
- -on1 "propModTypeCallback 3"
- -on2 "propModTypeCallback 4" modType2;
-
- radioButtonGrp -e
- -on1 "propModTypeCallback 5" modType3;
-
- checkBoxGrp -e
- -on1 "propModDirCheckToVec 0 1"
- -on2 "propModDirCheckToVec 1 1"
- -on3 "propModDirCheckToVec 2 1"
- -of1 "propModDirCheckToVec 0 0"
- -of2 "propModDirCheckToVec 1 0"
- -of3 "propModDirCheckToVec 2 0"
- modDir;
-
- floatSliderGrp -e
- -cc "propModLinearDistToSlope #1"
- linearField;
-
- floatSliderGrp -e
- -cc "propModLinearParamCutoff 0 #1"
- linearFieldU;
-
- floatSliderGrp -e
- -cc "propModLinearParamCutoff 1 #1"
- linearFieldV;
-
- floatSliderGrp -e
- -cc "propModCtx -e -pc #1 `currentCtx`"
- powerCutoff;
-
- floatSliderGrp -e
- -cc "propModPowerCutoff 0 #1"
- powerCutoffU;
-
- floatSliderGrp -e
- -cc "propModPowerCutoff 1 #1"
- powerCutoffV;
-
- floatSliderGrp -e
- -cc "propModCtx -e -pd #1 `currentCtx`"
- powerDegree;
-
- floatSliderGrp -e
- -cc "propModCtx -e -pdp #1 `currentCtx`"
- powerDegreeParam;
-
- textFieldGrp -e
- -cc "propModCtx -e -s #1 `currentCtx`"
- scriptName;
-
- textFieldGrp -e
- -cc "propModCtx -e -sp #1 `currentCtx`"
- scriptNameParam;
-
- textField -edit
- -cc "propModAnimCurveSet \"#1\""
- animCurveName;
-
- textField -edit
- -cc "propModAnimCurveParamSet \"#1\""
- animCurveNameParam;
-
- textField -edit
- -cc "propModCtx -e -nc #1 `currentCtx`"
- nurbsCurveName;
- }
-
- global proc createAnimCurvesPopup()
- {
- global string $gPropModAnimCurvePrefix;
-
- popupMenu -e -dai animCurvePopup;
- setParent -menu animCurvePopup;
-
- string $all[] = `ls ($gPropModAnimCurvePrefix + "*")`;
- string $select = "";
- int $i, $n;
-
- $n = size($all);
-
- if( $n > 0 ) {
- $select = "select -d ";
- for( $i=0; $i<$n; $i+=1 ) {
- $select = $select + ( $all[$i] + " " );
- }
- $select = $select + "; ";
-
- for( $i=0; $i<$n; $i+=1 ) {
- menuItem -l $all[$i]
- -c ($select + "select -add " + $all[$i] + "; " +
- "propModAnimCurveSet " + $all[$i] + "; ");
- }
- }
- else {
- menuItem -l ("No anim curves with prefix " + $gPropModAnimCurvePrefix );
- }
- menuItem -d true;
- menuItem -l "Create New"
- -c "propModAnimCurveSet \"\";";
- }
-
- global proc createAnimCurvesParamPopup()
- {
- global string $gPropModAnimCurvePrefix;
-
- popupMenu -e -dai animCurveParamPopup;
- setParent -menu animCurveParamPopup;
-
- string $all[] = `ls ($gPropModAnimCurvePrefix + "*")`;
- string $select = "";
- int $i, $n;
-
- $n = size($all);
-
- if( $n > 0 ) {
- $select = "select -d ";
- for( $i=0; $i<$n; $i+=1 ) {
- $select = $select + ( $all[$i] + " " );
- }
- $select = $select + "; ";
-
- for( $i=0; $i<$n; $i+=1 ) {
- menuItem -l $all[$i]
- -c ($select + "select -add " + $all[$i] + "; " +
- "propModAnimCurveParamSet " + $all[$i] + "; ");
- }
- }
- else {
- menuItem -l ("No anim curves with prefix " + $gPropModAnimCurvePrefix );
- }
- menuItem -d true;
- menuItem -l "Create New"
- -c "propModAnimCurveParamSet \"\";";
- }
-
- global proc createNurbsCurvesPopup()
- {
-
- popupMenu -e -dai nurbsCurvePopup;
- setParent -menu nurbsCurvePopup;
-
- string $all[] = `ls -lf -dag -type "nurbsCurve"` ;
- string $select = "";
- int $i, $n;
-
- $n = size($all);
-
- if( $n > 0 ) {
- for( $i=0; $i<$n; $i+=1 ) {
- menuItem -l $all[$i]
- -c ( "propModNurbsCurveSet " + $all[$i] + "; ");
- }
- }
- else {
- menuItem -l ("No NURBS curves." );
- }
- }
-
-
- global proc propModProperties()
- //
- // Description:
- // This procedure builds the property sheet and assigns callbacks to
- // its controls. The state of the controls are set in propModValues().
- //
- //
- {
- // Defined as part of OptionsTemplate in setDefaultTemplates.mel.
- //
- global int $gOptionsTemplateControlAreaWidth;
- global int $gOptionsTemplateExtraWidth;
-
- string $parent = `toolPropertyWindow -q -location`;
-
- setUITemplate -pushTemplate OptionsTemplate;
-
- setParent $parent;
-
- columnLayout propMod;
-
- $parent = `setParent -query`;
- separator -style "none";
-
- radioButtonGrp -nrb 2 -sl 1 -l "Modification Type"
- -l1 "World" -l2 "Parametric(NURBS)"
- modSpace;
-
- radioButtonGrp -nrb 2 -sl 1 -l "Modification Falloff"
- -l1 "Linear" -l2 "Power"
- modType;
- radioButtonGrp -nrb 2 -l ""
- -l1 "Script" -l2 "Curve"
- -scl modType
- modType2;
-
- radioButtonGrp -nrb 1 -l ""
- -l1 "NURBS Curve"
- -scl modType
- modType3;
-
- tabLayout -tabsVisible false propModTypeTabs;
-
- // Power tab parametric.
- //
- // ** The tab with the largest number of controls needs to come first, to reserve enough vertical
- // space in the layout
- //
- columnLayout propModPowerParamTab;
- floatSliderGrp -field true
- -l "Distance Cutoff U"
- -fmn -100.0 -fmx 100.0
- -min 0.01 -max 20.0
- -v 0.5
- -pre 2
- powerCutoffU;
- floatSliderGrp -field true
- -l "Distance Cutoff V"
- -fmn -100.0 -fmx 100.0
- -min 0.01 -max 20.0
- -v 0.5
- -pre 2
- powerCutoffV;
- floatSliderGrp -field true
- -l "Degree"
- -min -5.0 -max 5.0 -v -0.1
- powerDegreeParam;
- setParent ..;
-
-
- // Power tab.
- //
- columnLayout propModPowerTab;
- floatSliderGrp -field true
- -l "Distance Cutoff"
- -fmn -100.0 -fmx 100.0
- -min 0.01 -max 20.0
- -v -0.1
- -pre 2
- powerCutoff;
-
- floatSliderGrp -field true
- -l "Degree"
- -min -5.0 -max 5.0 -v -0.1
- powerDegree;
- setParent ..;
-
-
- // Linear tab -- Parametric.
- //
- columnLayout propModLinearParamTab;
- floatSliderGrp -field true
- -l "Distance Cutoff U"
- -fmn 0.0 -fmx 1000.0
- -min 0.0 -max 10.0
- -s 0.05
- -ss 0.05
- -v 0.5
- -pre 2
- linearFieldU;
- floatSliderGrp -field true
- -l "Distance Cutoff V"
- -fmn 0.0 -fmx 1000.0
- -min 0.0 -max 10.0
- -s 0.05
- -ss 0.05
- -v 0.5
- -pre 2
- linearFieldV;
- setParent ..;
-
-
- // Linear tab.
- //
- columnLayout propModLinearTab;
- floatSliderGrp -field true
- -l "Distance Cutoff"
- -fmn -1000.0 -fmx 1000.0
- -min 0.01 -max 20.0
- -v -0.1
- -pre 2
- linearField;
- setParent ..;
-
-
- // Script tab - Parametric.
- //
- columnLayout propModScriptParamTab;
- textFieldGrp -l "User Defined Script" scriptNameParam;
- setParent ..;
-
-
- // Script tab.
- //
- columnLayout propModScriptTab;
- textFieldGrp -l "User Defined Script" scriptName;
- setParent ..;
-
-
- // Anim curve tab - Parametric.
- //
- columnLayout propModAnimParamTab;
- rowLayout -numberOfColumns 3
- -columnAttach 3 "left" 0
- -columnWidth 2 $gOptionsTemplateControlAreaWidth
- -columnWidth 3 $gOptionsTemplateExtraWidth
- ;
- text -label "Anim. Curve";
- textField animCurveNameParam;
- symbolButton -image "dropArrow.xpm" -height 22;
- popupMenu -button 1 -postMenuCommand "createAnimCurvesParamPopup"
- animCurveParamPopup;
- setParent ..;
-
- floatSliderGrp -field true
- -l "Scale U"
- -min 0.0 -max 1.0
- -v 1.0
- -pre 2
- animParamFieldU;
- floatSliderGrp -field true
- -l "Scale V"
- -min 0.0 -max 1.0
- -v 1.0
- -pre 2
- animParamFieldV;
- setParent ..;
-
-
- // Anim curve tab.
- //
- columnLayout propModAnimTab;
- rowLayout -numberOfColumns 3
- -columnAttach 3 "left" 0
- -columnWidth 2 $gOptionsTemplateControlAreaWidth
- -columnWidth 3 $gOptionsTemplateExtraWidth
- ;
- text -label "Anim. Curve";
- textField animCurveName;
- symbolButton -image "dropArrow.xpm" -height 22;
- popupMenu -button 1 -postMenuCommand "createAnimCurvesPopup"
- animCurvePopup;
- setParent ..;
- setParent ..;
-
- //
- // NURBS curve tab -- parametric version. This is simply an empty placeholder to clear
- // the tab
- //
- columnLayout propModNurbsParamTab;
- setParent ..;
-
-
- // NURBS curve tab (there is no parametric version).
- //
- columnLayout propModNurbsTab;
- rowLayout -numberOfColumns 3
- -columnAttach 3 "left" 0
- -columnWidth 2 $gOptionsTemplateControlAreaWidth
- -columnWidth 3 $gOptionsTemplateExtraWidth
- ;
- text -label "NURBS Curve";
- textField nurbsCurveName;
- symbolButton -image "dropArrow.xpm" -height 22;
- popupMenu -button 1 -postMenuCommand "createNurbsCurvesPopup"
- nurbsCurvePopup;
- setParent ..;
- setParent ..;
-
-
- setParent ..;
-
- tabLayout -tabsVisible false propModDirTabs;
- columnLayout propModDirVis;
- checkBoxGrp -ncb 3 -l "Distance Based On"
- -l1 "X" -l2 "Y" -l3 "Z"
- -v1 on -v2 on -v3 on
- modDir;
- setParent ..;
- columnLayout propModDirInvis;
- setParent ..;
- setParent ..;
-
-
- setParent ..; // propMod
-
- setUITemplate -popTemplate;
-
- propModSetCallbacks( $parent );
- }
-
-